package com.lagou.mr.sort;


import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;

import java.io.IOException;

public class NumberSortMapper extends Mapper<LongWritable, Text, NumberSortBean,
        NullWritable> {
    @Override
    protected void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException {
        //初始化排序数字对象，排序号初始化为0
        final NumberSortBean bean = new NumberSortBean(Long.parseLong(value.toString()),0L);
        context.write(bean,NullWritable.get());
    }
}
